package com.hex.ds.hdrs.period.job.po;

import cn.hutool.core.util.StrUtil;
import com.hex.ds.hdrs.common.constant.Const;
import com.hex.ds.hdrs.period.task.po.PeriodTask;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

@Data
@Accessors(chain = true)
public class PeriodJob implements Serializable {

    private String pkId;

    private String appCode;

    private String appointAgentCode;

    private String jobCode;

    private String jobName;

    private String jobStatus;

    private String jobStTs;

    private String jobEndTs;

    private Integer sortNo;

    private String bizDate;

    private String crtTs;

    private String upUser;

    private String upTs;

    private String crtUser;

    private String errorInfo;

    // 扩展字段

    private String jobCodeFuzzy;

    private String labelName;

    private List<String> jobCodeList;

    private String jobNameFuzzy;

    private List<String> jobNameList;

    private String startTimeStart;

    private String startTimeEnd;

    private String endTimeStart;

    private String endTimeEnd;

    private String bizDateStart;

    private String bizDateEnd;

    private List<String> pkIds;

    private String taskStatusCount;

    @Override
    public int hashCode() {
        int result = getJobCode() != null ? getJobCode().hashCode() : 0;
        result = result + getBizDate().hashCode();
        return result;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PeriodJob periodJob = (PeriodJob) o;
        return StrUtil.equalsAnyIgnoreCase(this.getJobCode(), periodJob.getJobCode())
                && StrUtil.equalsAnyIgnoreCase(this.getBizDate(), periodJob.getBizDate());
    }
}